import axios from '~/plugins/axios';

/**
 * 获取品牌详细信息
 *
 * @param commit
 * @param state
 * @param preload
 */
export const brandDetailInfo = function({commit, state}, preload) {
    return axios.post(process.env.baseUrl + '/sauronBrand/getBrandDetailInfo', preload);
};


/**
 * 修改维权通信息
 *
 * @param commit
 * @param state
 * @param preload
 */
export const updateMaintenanceRightInfo = function({commit, state}, preload) {
    return axios.post(process.env.baseUrl + '/sauronBrand/updateMaintenanceRight', preload);
};


/**
 * 开通维权通
 *
 * @param commit
 * @param state
 * @param preload
 */
export const openMaintenanceRight = function({commit, state}, preload) {
    return axios.post(process.env.baseUrl + '/sauronBrand/addMaintenanceRight', preload);
};

/**
 * 增加品牌跟进信息
 *
 * @param commit
 * @param state
 * @param preload
 */
export const addBrandFollowInfo = function({commit, state}, preload) {
    return axios.post(process.env.baseUrl + '/sauronBrand/addBrandFollowInfo', preload);
};


/**
 * 获取品牌跟进信息列表
 *
 * @param commit
 * @param state
 * @param preload
 */
export const getBrandFollowInfoListByPage = function({commit, state}, preload) {
    return axios.post(process.env.baseUrl + '/sauronBrand/getBrandFollowInfoListByPage', preload);
};

/**
 * 获取品牌跟进信息置顶
 *
 * @param commit
 * @param state
 * @param preload
 */
export const getGoFirst = function({commit, state}, preload) {
    return axios.post(process.env.baseUrl + '/sauronBrand/goFirst', preload);
};

/**
 * 查询是否有过置顶
 *
 * @param commit
 * @param state
 * @param preload
 */
export const getHasFirst = function({commit, state}, preload) {
    return axios.post(process.env.baseUrl + '/sauronBrand/hasFirst', preload);
};

/**
 * 品牌列表
 *
 * @param commit
 * @param state
 * @param preload
 */ 
export const brandList = function({commit, state}, preload) {
    return axios.get(process.env.baseUrl + '/sauronBrand/getBrandListByOperationPerson', {
        params: preload || {}
    })
}; 
/**
 * 删除品牌
 *
 * @param commit
 * @param state
 * @param preload
 */
export const deleteBrand = function({commit, state}, preload) {
    return axios.post(process.env.baseUrl + '/sauronBrand/deleteBrand', preload)
}; 
/**
 * 品牌分配人员(要分配的类型1 知产,2 购买,3 对接)
 *
 * @param commit
 * @param state
 * @param preload
 */
export const distributePerson = function({commit, state}, preload) {
    return axios.post(process.env.baseUrl + '/sauronBrand/distributePerson', preload);
};

/**
 * 修改品牌状态 接口地址: sauronBrand/updateBrandStatus
 *brandId  updateType 必填
 * @param commit
 * @param state
 * @param preload
 */
export const updateBrandStatus = function({commit, state}, preload) {
    return axios.post(process.env.baseUrl + '/sauronBrand/updateBrandStatus', preload);
};

/**
 * 审批记录  sauronBrand/addBrandAudit
 *brandId  result 必填
 * @param commit
 * @param state
 * @param preload
 */
export const addBrandAudit = function({commit, state}, preload) {
    return axios.post(process.env.baseUrl + '/sauronBrand/addBrandAudit', preload);
};


/**
 * 获取历史审批记录  sauronBrand/getBrandAudit
 *brandId  result 必填
 * @param commit
 * @param state
 * @param preload
 */
export const getBrandAudit = function({commit, state}, preload) {
    return axios.post(process.env.baseUrl + '/sauronBrand/getBrandAudit', preload);
};

export const getSelfBrandsList = function({commit, state}, preload) {
    return axios.get(process.env.baseUrl + '/sauronBrand/getSelfBrandsListforOperation', {
        params: preload || {}
    })
};

export const getSelfBrands = function({commit, state}, preload) {
    return axios.get(process.env.baseUrl + '/sauronBrand/getSelfBrands', {
        params: preload || {}
    })
};


export const getBrandCateory = function({commit, state}, preload) {
    return axios.get(process.env.baseUrl + '/baseInfo/getBrandTypeList', {
        params: preload || {}
    })
};